package com.leapp.sk.ui.activity.task

import android.os.Bundle
import android.support.v4.app.Fragment
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.bean.TopLayoutTitleEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.ui.fragment.task.submit.SubmitCompleteFragment
import com.leapp.sk.ui.fragment.task.submit.UnSubmitFragment
import com.leapp.sk.viewdelegate.task.TeacherParentTaskDelegate

/**
 * 亲子作业完成度
 * @author  chaohaipeng  on 2018/8/10.
 */
class ParentTaskCompleteDegreeActivity : BaseActivityMVP<TeacherParentTaskDelegate>() {

        /**
         * fragment数据集合
         */
        private var fragmentLists = mutableListOf<Fragment>()
        /**
         * 标签集合
         */
        private var titles = mutableListOf<TopLayoutTitleEntity>()
        override fun initDate() {
            fragmentLists.add(SubmitCompleteFragment())
            fragmentLists.add(UnSubmitFragment())
            val topULayoutTitleEntity = TopLayoutTitleEntity()
            topULayoutTitleEntity.title = String.format(resources.getString(R.string.string_task_submit), 5)
            val topRLayoutTitleEntity = TopLayoutTitleEntity()
            topRLayoutTitleEntity.title = String.format(resources.getString(R.string.string_task_un_submit), 10)
            titles.add(topULayoutTitleEntity)
            titles.add(topRLayoutTitleEntity)
            viewDelegate.initTabLayout(this,fragmentLists,titles)
        }

        override fun bindEvenListener() {
        }

        override fun getDelegateClass(): Class<TeacherParentTaskDelegate> {
            return TeacherParentTaskDelegate::class.java
        }

        override fun getDataBinder(): BaseDataBinder<*, *> {
            return BaseBinder()
        }

        override fun initView(p0: Bundle?) {
            viewDelegate.setTitle(resources.getString(R.string.string_task_parenting))
        }
}